import { app } from "electron";
import windowUtils from "./windowUtils";

export const checkSecondInstance = () => {
    const lock = app.requestSingleInstanceLock()
    if (!lock) {
        app.quit()
    } else {
        app.on('second-instance', () => {
            if (windowUtils.mainWindow?.isMinimized()) {
                windowUtils.mainWindow?.restore()
            }
        })
    }
}